<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page contentType="text/html;charset=UTF-8" %>
<%@page import="com.lmpop.trade.ts_custclass.*" %>
<%@page import="java.util.*" %>
<%@page import="com.lmpop.frame.util.PageTools" %>
<%
	request.setCharacterEncoding("UTF-8");
	Map ts_custclass = new Hashtable();
	String s_class_type = "";
	if(request.getParameter("s_class_type")!=null && !request.getParameter("s_class_type").equals("")){
		s_class_type = request.getParameter("s_class_type");
		ts_custclass.put("class_type",s_class_type);
	}
	String s_class_name= "";
	if(request.getParameter("s_class_name")!=null && !request.getParameter("s_class_name").equals("")){
		s_class_name = request.getParameter("s_class_name");
		ts_custclass.put("cust_class_name",s_class_name);
	}	
	Ts_custclassInfo ts_custclassInfo = new Ts_custclassInfo();
	String iStart = "0";
	int limit = 20;
	if(request.getParameter("iStart")!=null) iStart = request.getParameter("iStart");
	List list = ts_custclassInfo.getListByPage(ts_custclass,Integer.parseInt(iStart),limit);
	
	int counter = ts_custclassInfo.getCountByObj(ts_custclass);
	String pageString = new PageTools().getGoogleToolsBar(counter,"index.jsp?iStart=",Integer.parseInt(iStart),limit);
%>
<html>
  <head>
    
    <title>级别设置</title>
	<link href="/program/admin/index/css/style.css" rel="stylesheet" type="text/css">
	<script type="text/javascript" src="/js/commen.js"></script>
	<script type="text/javascript" src="custclass.js"></script>
</head>

<body>
	<table width="100%" cellpadding="0" cellspacing="0" border="0">
		<tr>
			<td width="90%">
				<h1>级别设置</h1>
			</td>
			<td>
				<a href="addInfo.jsp"><img src="/program/admin/index/images/post.gif" /></a>
			</td>
		</tr>
	</table>
	
	<form action="index.jsp" name="indexForm" method="post">
	
	<!--
	<table width="100%" align="center" cellpadding="0" cellspacing="0" class="dl_so">
        <tr>
          <td width="9%" align="center"><img src="/program/admin/index/images/ban_01.gif" /></td>
          <td width="91%" align="left">
		  <h4>-----------------</h4>
		  <span>1----------------。</span><br/>
		  <span>2----------------。</span>
		  </td>
        </tr>
      </table>
      <br/>
	  -->
	  
	<table width="100%" cellpadding="0" cellspacing="0" class="dl_su">
		<tr>
			<td align="left" >
				按级别名称：<input name="s_class_name" id="s_class_name" type="text" />&nbsp;
				按级别类型：<select name="s_class_type" id="s_class_type">
									  <option value="">请选择</option>
									  <option value="0">企业会员</option>
									  <option value="1">个人会员</option>
									  </select>
				<input name="searchInfo" type="button" value="查询" onClick="searcher();"/>	
				
			</td>
		</tr>
	</table>

	<table width="100%" cellpadding="0" cellspacing="0" border="0" class="tablehe">
		<tr><td><%=pageString %></td></tr>
	</table>
	
	<% 
		int listsize = 0;
		if(list!=null && list.size()>0){
			listsize = list.size();
	%>
	
	<table width="100%" cellpadding="0" cellspacing="0" border="0" class="dl_bg">
		<tr>
			<td width="90%">
				<input type="button" name="delInfo" onClick="delIndexInfo()" value="删除" class="buttab"/>
			</td>
			<td>
				总计:<%=counter %>条
			</td>
		</tr>
	</table>
	
	<table width="100%" cellpadding="1" cellspacing="1" class="listtab" border="0">
		<tr>
			<th width="5%" align="center"><input type="checkbox" name="checkall" id="checkall" onClick="selectAll()"></th>
			
			<th>级别代码</th>
			
		  	<th>级别名称</th>	  	
			
		  	<th>级别类型</th>

			<th>编辑权限</th>		  	
			
	  		<th width="10%">删除</th>
		</tr>
		
		
		<% 
		  		for(int i=0;i<list.size();i++){
		  			Hashtable map = (Hashtable)list.get(i);
		  			String cust_class="",cust_class_name="",class_type="",cust_oper_person="",cust_oper_date="",remark="";
		  			  	if(map.get("cust_class")!=null) cust_class = map.get("cust_class").toString();
  	if(map.get("cust_class_name")!=null) cust_class_name = map.get("cust_class_name").toString();
  	if(map.get("class_type")!=null) class_type = map.get("class_type").toString();
  	if(map.get("cust_oper_person")!=null) cust_oper_person = map.get("cust_oper_person").toString();
  	if(map.get("cust_oper_date")!=null) cust_oper_date = map.get("cust_oper_date").toString();
if(cust_oper_date.length()>19)cust_oper_date=cust_oper_date.substring(0,19);
  	if(map.get("remark")!=null) remark = map.get("remark").toString();
	
	String class_type_string  = "<option value='0' selected>企业会员</option><option value='1'>个人会员</option>";
	
	if(class_type.equals("1")){
		class_type_string="<option value='0'>企业会员</option><option value='1' selected>个人会员</option>";
	}

	
		  %>
		
		<tr>
			<td width="5%" align="center"><input type="checkbox" name="checkone<%=i %>" id="checkone<%=i %>" value="<%=cust_class %>" /></td>
			
			<td><%=cust_class%></td>
			
		  	<td><input type="text" name="cust_class_name_<%=i %>" id="cust_class_name_<%=i %>" value="<%=cust_class_name%>" disabled /></td>
		  	
		  	<td><!--<select name="class_type_<%=i %>" id="class_type_<%=i %>"><%=class_type_string%></select>-->
				<input type="text" name="class_type_<%= i%>" id="class_type_<%=i %>" value="<%
					if(class_type.equals("1")){%>个人会员<%}else{%>企业会员<%}%>" disabled />
			</td>

			<td width="10%"><a href="/program/admin/rightinfo/addInfo.jsp?cust_class=<%=cust_class %>&classtype=c&class_type=<%=class_type %>"><img src="/program/admin/images/edit.gif" title="编辑" /></a></td>
			
	  		<td width="10%"><a href="javascript:deleteOneInfo('<%=cust_class%>','9113');"><img src="/program/admin/images/delete.gif" title="删除" /></a></a></td>
		</tr>
		
		  <%
		  		}
		  %>
		
	</table>
	
	<table width="100%" cellpadding="0" cellspacing="0" border="0" class="dl_bg">
		<tr>
			<td width="90%">
				<input type="button" name="delInfo" onClick="delIndexInfo()" value="删除" class="buttab"/>
			</td>
			<td>
				总计:<%=counter %>条
			</td>
		</tr>
	</table>
	<table width="100%" cellpadding="0" cellspacing="0" border="0" class="tablehe">
		<tr><td><%=pageString %></td></tr>
	</table>
	
	<%
		 }
	%>
	
	  <input type="hidden" name="listsize" id="listsize" value="<%=listsize %>" />
	  <input type="hidden" name="pkid" id="pkid" value="" />
	  <input type="hidden" name="bpm_id" id="bpm_id" value="9113" />
	  </form>
</body>

</html>
